package com.shuwei.wificollecttool.recognize.dao;

import com.shuwei.location.wificollect.WifiItem;

import java.util.ArrayList;
import java.util.List;

public class FingerPrint9KindDao implements IFingerPrintDao {

    public FingerPrint9KindDao() {
    }

    @Override
    public List<List<WifiItem>> queryAllFingerPrint() {
        List<List<WifiItem>> list = new ArrayList<>();
        for (int i = 0; i < TmpData9Kind.FINGER_AP.size(); i++) {
            String[] wifiList = TmpData9Kind.FINGER_AP.get(i);
            int[] rssiList = TmpData9Kind.FINGER_AP_RSSI.get(i);
            List<WifiItem> wifiListContainer = new ArrayList<>();
            for (int j = 0; j < wifiList.length; j++) {
                String mac = wifiList[j];
                int rssi = rssiList[j];
                WifiItem wifiItem = new WifiItem();
                wifiItem.setBssid(mac);
                wifiItem.setRssi(rssi);
                wifiListContainer.add(wifiItem);
            }
            list.add(wifiListContainer);
        }
        return list;
    }
}
